#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
//int fun(int x, int y) {
//	static int m = 0;
//	static int i = 2; 
//	i += m + 1; 
//	m = i + x + y;
//	return m;
//}
//struct tagTest1 { short a; char d; long b; long c; }; 
//struct tagTest2 { long b; short c; char d; long a; }; 
//struct tagTest3 { short c; long b; char d; long a; };
//int fib(int n)
//{
//	int f1 = 1;
//	int f2 = 1;
//	int f3 = 1;
//	for (int i = 1; i <=n; i++)
//	{	
//		if (i == 1||i==2)
//		{
//			continue;
//		}
//		f3 = f2 + f1;
//		f1 = f2;
//		f2 = f3;
//	}
//	return f3;
//}
//#define F(X,Y) ((X)+(Y))
//int exchange(char* arr1, char* arr2)
//{
//	while (*arr1 != '\0'){
//		if (*arr1 != ' '){
//			*arr2 = *arr1;
//			arr2++;
//		}
//		else if(*arr1==' '){
//			strcpy(arr2, "%20");
//			arr2 = arr2 + 3;
//		}
//		arr1++;
//	}
//	*arr2 = '\0';
//	return 0;
//}
//enum ENUM_A { X1, Y1, Z1 = 5, A1, B1 };
//int number(unsigned int n)
//{
//	int count = 0;
//	while (n!=0)
//	{
//		count++;
//		n = n & (n - 1);
//	}
//	return count;
//}
int main()
{
	/*char a[20]; 
	char* p1 = (char*)a;
	char* p2 = (char*)(a + 5); 
	int n = p2 - p1;
	printf("%d",n);*/
	/*int a = 3, b = 4;
	printf("%d\n", F(a++, b++));*/
	/*int a = 0x13 & 0x17;
	printf("%",a);*/
	//char str[6] = { '\0' };
	//char str[7] ="string";
	/*const char* p = "Hello";
	printf("%c",*p);*/
	/*int a = 10;
	a += a *= a -= a / 3;
	printf("%d",a);*/
	/*int i = 0;
	int count = 0;
	while (i < 10)
	{
		count++;
		if (i < 1)
		{
			continue;
		}
		if (i == 5)
		{
			break;
		}
		i++;
	}
	printf("%d", count);*/
	/*char arr1[400];
	char arr2[400];
	gets(arr1);
	exchange(arr1, arr2);
	printf("%s",arr2);*/
	/*int a = 5; 
	if (a = 0) 
	{ 
		printf("%d", a - 10);
	}
	else 
	{ 
		 printf("%d", a++);
	}*/
	/*double a[3][4];
	printf("%d",sizeof(a));*/
	/*int x=2 ,z = 2, y = 3; 
	if (x > y) z = 1;
	else if (x == y)
		z = 0; 
	else
		z = -1;
	printf("%d",z);*/
	/*char acHello[] = "hello\0world"; 
	char acNew[15] = { 0 }; 
	strcpy(acNew, acHello);
	int n = strlen(acNew);*/
	//printf("%d",sizeof(acHello));
	//printf("%d",n);
	/*int n;
	scanf("%d",&n);
	printf("%d",fib(n));*/
	/*int i = 1, sum = 0; 
	while (i < 10) 
	{ sum = sum + 1; i++; }
	printf("i=%d,sum=%d",i, sum);*/
	/*int x = 5 > 1 + 2 && 2 || 2 * 4 < 4 - !0;
	printf("%d",x);*/
	/*struct tagTest1 stT1; 
	struct tagTest2 stT2;
	struct tagTest3 stT3;
	printf("%d %d %d", sizeof(stT1), sizeof(stT2), sizeof(stT3));*/
	/*enum ENUM_A enumA = Y1; enum ENUM_A enumB = B1;
	printf("%d %d",enumA,enumB);*/
	/*int j = 4; 
	int m = 1; 
	int k; 
	k = fun(j, m); 
	printf("%d,", k);
	k = fun(j, m);
	printf("%d\n", k);*/
	unsigned int n;
	scanf("%u",&n);
	printf("%d", number(n));
	return 0;
}